package com.dvt.faceScan.httpUntil;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by XGJ on 2018/3/30.
 */

public  class DataUtil {

    //减8小时
    public static String timeUtil(){
        String _time;
        Long curTime = new Date().getTime();
        Long resTime = curTime-8*60*60*1000;
        Date result = new Date(resTime);
        DateFormat bf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
        _time = bf.format(result);
        return _time;
    }

    //减24小时
    public static String dayUtil(){
        String _time;
        Long curTime = new Date().getTime();
        Long resTime = curTime-24*60*60*1000;
        Date result = new Date(resTime);
        DateFormat bf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" );
        _time = bf.format(result);
        return _time;
    }



}
